home *** CD-ROM | disk | FTP | other *** search
/ MASPC 1 / MASPC_1.iso / Demos / Demo DIV / DATA / DLL / SOURCE / DEMO0.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-24  |  574 b   |  29 lines

  1.  
  2. #include <stdio.h>
  3.  
  4. #define GLOBALS
  5. #include "div.h"
  6.  
  7. void ss_init(void) { // Función de inicialización del salvapantallas.
  8.  
  9.   ss_time=1500; // Llamar al salvapantallas tras 15 segundos de inactividad.
  10.  
  11. }
  12.  
  13. void ss_frame(void) { // Pone "wide" puntos en negro, aleatoriamente
  14.   int x,y,n=0;
  15.  
  16.   for (n=0;n<wide;n++) {
  17.     x=div_rand(0,wide-1);
  18.     y=div_rand(0,height-1);
  19.     *(buffer+x+y*wide)=0;
  20.   }
  21. }
  22.  
  23. void __export divmain(COMMON_PARAMS) {
  24.   AutoLoad();
  25.   GLOBAL_IMPORT();
  26.   DIV_export("ss_init",ss_init);
  27.   DIV_export("ss_frame",ss_frame);
  28. }
  29.